<include file="Public/head"/>
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.css"/>
<script src="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.js" type="text/javascript"></script>
<style type='text/css'>
    #reserve_start_time {
        height: 24px;
        border: solid 1px #c5c5c5;
        background: url(http://img1.isou365.cn/paimai/yunying/images/time_pic.jpg) no-repeat 120px 5px;
        cursor: pointer;
    }

    #reserve_end_time {
        height: 24px;
        border: solid 1px #c5c5c5;
        background: url(http://img1.isou365.cn/paimai/yunying/images/time_pic.jpg) no-repeat 120px 5px;
        cursor: pointer;
    }

    .table tbody tr td a:link {
        color: #20ab4f;
        text-decoration: underline;
    }

    .table tbody tr td a:visited {
        text-decoration: underline;
        color: #303030;
    }

    .table tbody tr td a:hover {
        text-decoration: underline;
        color: #20ab4f;
    }

    .table tbody tr td a:active {
        color: #f99d0c;
        text-decoration: underline;
    }

    .table tbody tr td a.not-point {
        color: #9f9f9f;
        text-decoration: none;
    }

    .search6 {
        display: block;
        clear: left;
        padding-top: 10px;
    }

    .search6-input {
        margin-left: 0 !important;
    }

    #searchFrom .branch_company {
        text-indent: 2px;
    }
</style>
</head>
<include file="Public/common_header"/>
<div class="mian">
    <include file="Public/sidebar" menu="clcwht.zxsh"/>
    <div class="mianR">
        <div class="yuList">
            <form id="searchFrom">
                <div class="yuSuo clearfix">
                    <div id="search1">
                        <select id="category_id" name="category_id" class="branch_company">
                            <option value="0">请选择主频道</option>
                            <volist name="cate" id="vo" key="k">
                                <option value="{$vo.category_id}">{$vo.category_title}</option>
                            </volist>
                        </select>
                        <select id="child_id" name="child_id" class="branch_company">
                            <option value="0">请选择子频道</option>
                        </select>
                        <select id="status" name="status" class="branch_company">
                            <option value="">请选择发布状态</option>
                            <option value="1">已发布</option>
                            <option value="2">未发布</option>
                            <option value="3">预发布</option>
                        </select>
                        <input type="text" id="article_title" name="article_title" placeholder="请输入标题关键字" value="">
                        <input type="text" id="start_time" name="start_time" value="" readonly placeholder="发布时间起"/><em></em>
                        <input type="text" id="end_time" name="end_time" value="" readonly placeholder="发布时间止" style="margin-right: 10px;"/>
                    </div>
                    <input type="button" onclick="searchList();" id="search" value="搜索" class="suoSou">
                </div>
                <div class="yuSuo clearfix">
                    <div id="search1">
                        <select id="article_type" name="article_type" class="branch_company">
                            <option value="0">请选择资讯类型</option>
                            <option value="1">原创</option>
                            <option value="2">转载</option>
                        </select>
                        <select id="article_from" name="article_from" class="branch_company">
                            <option value="">请选择资讯来源</option>
                            <option value="车享家">车享家</option>
                            <option value="易车">易车</option>
                            <option value="搜狐汽车">搜狐汽车</option>
                            <option value="汽车之家">汽车之家</option>
                        </select>
                        <span>是否精华：</span><span>是</span><input type="radio" name="is_top" value="1" /><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span>否</span><input type="radio" name="is_top" value="0" />
                    </div>
                </div>
            </form>
        </div>
        <div class="listBox" id="listBox">

        </div>
    </div>
    <div class="clear"></div>
    <include file="Public/foot"/>
    <script type="text/javascript">
        $(function () {
            $("#category_id").change(function () {
                var category_id = $(this).val();
                if (category_id > 0) {
                    $.get('/Article/getChildCategory', {category_id: category_id}, function (data) {
                        var html = '<option value="">全部</option>';

                        for (var i in data) {
                            html += "<option value=\"" + data[i].category_id + "\">" + data[i].category_title + "</option>";
                        }
                        $('#child_id').html(html);

                    }, 'json');
                } else {
                    $('#child_id').html('<option value="">请选择子频道</option>');
                }
            });
        });
        $("#start_time").ymdateplugin({
            changeMonth: true,
            changeYear: true
        });
        $("#end_time").ymdateplugin({
            changeMonth: true,
            changeYear: true
        });

        var page = 1;

        get_list();

        function get_list(params) {
            var url = get_url();

            $.get("/ArticleCrawler/articleCrawlerList", params, function (data) {
                $("#listBox").html(data);
            }, "html");
        }

        function get_page(p) {
            page = p;
            searchList();
        }

        function searchList() {
            var params = {};
            var is_top = $('input[name="is_top"]:checked').val();
            params.p = page;
            if (is_top) {
                params.is_top = is_top;
            }
            var article_title = $('#article_title').val();
            if (article_title) {
                params.article_title = article_title;
            }
            var category_id = $('#category_id').val();
            if (category_id) {
                params.category_id = category_id;
            }
            var child_id = $('#child_id').val();
            if (child_id) {
                params.child_id = child_id;
            }
            var status = $('#status').val();
            if (status) {
                params.status = status;
            }
            var article_type = $('#article_type').val();
            if (article_type) {
                params.article_type = article_type;
            }
            var article_from = $('#article_from').val();
            if (article_from) {
                params.article_from = article_from;
            }
            var start_time = $('#start_time').val();
            if (start_time) {
                params.start_time = start_time;
            }
            var end_time = $('#end_time').val();
            if (end_time) {
                params.end_time = end_time;
            }
            get_list(params);
        }

        function get_url() {
            var url = "";
            return url;
        }


    </script>